package client;

import shared.Stringable;

public class Point2 implements Stringable{
	
	@XMLRMIField(serializationName="x", serializationType="int")
	protected int tt1 = 1000;
	
	@XMLRMIField(serializationName="y", serializationType="int")
	protected int tt2 = 500;
	
	@XMLRMIField(serializationName="marque", serializationType="String")
	protected String m = " x ";
	
	@XMLRMIField(serializationName="testBool", serializationType="boolean")
	protected boolean testBoo= true;
	
	@XMLRMIField(serializationName="testFloat", serializationType="double")
	protected float testFloa= (float) 3.15;
	
	@XMLRMIField(serializationName="testIntTab", serializationType="int")
	protected int[] testIntTa= {1,2,3,5};
	
	@XMLRMIField(serializationName="testUltime", serializationType="array")
	protected int[][][] testUltime= {{{1},{2,3},{4,5,6},{7,8,9,10},{11,12,13,14,15},{16,17,18,19,20,21}},{{22,23,24,25,26},{27,28,29,30}},{{31,32,33},{34,35},{36}}};
	
	@XMLRMIMethod(serializationCode="public String toString(){int total=0;for(int i=0;i<testUltime.length;i++){for(int j=0;j<testUltime[i].length; j++){for(int k=0; k<testUltime[i][j].length;k++){total+=testUltime[i][j][k];}}}return \"Le total du tableau vaut : \"+total+\" et il vaut \"+x;}"
	)
	public String toString(){
		int total=0;
		for(int i=0;i<testUltime.length;i++){
			for(int j=0;j<testUltime[i].length; j++){
				for(int k=0; k<testUltime[i][j].length;k++){
					total+=testUltime[i][j][k];
				}
			}
		}
		
		return "Le total du tableau vaut : "+total;
	}
	
	public Point2(int a){
		tt1 = a;
	}

	@XMLRMIMethod(serializationCode="public int add(int a, int b){return a + b;}")
	public int add(int a, int b) {
		return a+b;
	}

}
